//
// Created by admin on 2024/12/4.
//

#ifndef AVM_RENDER_BARRIERCURVERENDER_H
#define AVM_RENDER_BARRIERCURVERENDER_H

#include "CurveSamples.h"
#include <memory>
/**
 * @brief 渲染障碍物曲线
 */
class BarrierCurveRender {
public:
    BarrierCurveRender();
    ~BarrierCurveRender();

    // test
    int getMiddleSampleSize();
    Point getMiddleSample(int index);
    Point getLeftSample(int index);
    Point getRightSample(int index);
    std::shared_ptr<unsigned int> ptr_index_buffer = nullptr;
    std::shared_ptr<float> ptr_vertex_buffer = nullptr;
    int ebo_size = 0;

private:
    CurveSamples m_samples;
    CurveSamples m_test_left_samples;
    CurveSamples m_test_right_samples;

    void initResources();
    void static generateQuarterCircle(unsigned int sampleCount, unsigned int R, CurveSamples * samples);
};


#endif //AVM_RENDER_BARRIERCURVERENDER_H
